package com.xc.sbdemo.service;


import com.xc.sbdemo.entity.Movie;
import com.xc.sbdemo.mapper.MovieMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MovieServiceImpl implements MovieService{
    @Autowired
    private MovieMapper movieMapper;
    @Override
    public List<Movie> getList(Integer pageIndex, Integer pageSize) {
        Integer zz=(pageIndex-1)*pageSize;
        return movieMapper.getList(zz,pageSize);
    }

    @Override
    public int add(Movie movie) {
        return movieMapper.add(movie);
    }

    @Override
    public int count() {
        return movieMapper.count();
    }

    @Override
    public Movie selectByMovieName(String movieName) {
        return movieMapper.selectByMovieName(movieName);
    }

    @Override
    public Movie selectByMovieId(Integer movieId) {
        return movieMapper.selectByMovieId(movieId);
    }

    @Override
    public int modify(Movie movie) {
        return movieMapper.modify(movie);
    }

    @Override
    public int del(Integer movieId) {
        return movieMapper.del(movieId);
    }
}
